import http from '@/utils/http'
/**
 * 维护登录，获取用户信息等和用户有关的接口 api
 */
interface userInfo {
  phone: string
  password: string
}
interface responseToken {
  token: string
}
interface responseUserInfo {
  headImg: string
  loginName: string
}
// interface responseUserInfo {}
/**
 * @desc https://www.showdoc.com.cn/2077491945864902/9409408528292134
 * @param {*} data 手机号 密码
 * @returns Promise
 */
export const reqLogin = (data: userInfo) => {
  return http.post<any, responseToken>('/api/user/passport/login', data)
}

/**
 * @desc 专门用于获取用户信息
 * @returns Promise
 */
export const reqUserInfo = () => {
  return http.get<any, responseUserInfo>('/api/user/passport/auth/getUserInfo')
}

/**
 * @description 用于请求退出登录
 * @returns Promise
 */
export const reqLogout = () => http.get('/api/user/passport/logout')
